package com.samehope.ar.mapper;

import com.samehope.ar.entity.ProjectTeamMember;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.samehope.ar.vo.FormSelectVO;
import com.samehope.ar.vo.TeamMemberVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 项目团队成员 Mapper 接口
 * </p>
 *
 * @author Zhang Luo
 * @since 2019-12-23
 */
public interface ProjectTeamMemberMapper extends BaseMapper<ProjectTeamMember> {
    /**
     * 查找当前项目中的用户团队关系对象
     * @param projectId
     * @param userId
     * @return
     */
    ProjectTeamMember findByProjectAndUser(@Param("projectId") Long projectId,
                                           @Param("userId") Long userId);

    /**
     * 根据项目和团队查找团队成员
     * @param projectId
     * @param teamId
     * @return
     */
    List<TeamMemberVO> findMembersByProjectAndTeam(@Param("projectId") Long projectId,
                                                   @Param("teamId") Long teamId);

    /**
     * 根据项目查询项目组成员下拉框数据
     * @param projectId
     * @return
     */
    List<FormSelectVO> listForSelectByProject(Long projectId);
}
